<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="s" uri="/struts-tags"  %> 
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ page import="com.appsindy.reserv.ReservConstants" %>

<html> 
<head>
<sx:head parseContent="true"/>
<title>Manage Group</title>
<meta http-equiv="Pragma" content="text/html; charset=UTF-8" content="no-cache">

<link type="text/css" rel="stylesheet" href="css/standard.css" media="screen">
<style type="text/css">
	.button { width: 80px;}
	.list { width: 200px; }
</style>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/popup.js"></script>
<script type="text/javascript">            
<!--
	function groupForm(grpId, grpCode, grpName, grpTypeId){
		document.getElementById("grpId").value = grpId;
		document.getElementById("grpCode").value = grpCode;
		document.getElementById("grpName").value = grpName;
		document.getElementById("grpTypeId").value = grpTypeId;
		Popup.showModal('modal');
	}
//-->
</script>
</head>
 
<body background="images/top_page_bg.jpg">
<br>
<div id="modal" style="width: 400px; height: 280; border:3px solid black; background-color:#9999ff; padding:25px; font-size:150%; text-align:center; display:none;">
	<table width="90%">
	<s:form action="masterGroup_savePopup" method="POST" theme="simple">
	<s:token/>
	<s:hidden id="grpId" name="htGroup.groupId" />
	<tr>
		<td width="50%">Group Code</td>
		<td width="50%"><input type="text" id="grpCode" name="htGroup.groupCode"></td>
	</tr>
	<tr>
		<td>Group Name</td>
		<td><input type="text" id="grpName" name="htGroup.groupName"></td>
	</tr>
	<tr>
		<td>Group Type</td>
		<td>
			<s:select id="grpTypeId" name="htGroup.groupTypeId" theme="simple"
					  headerKey="0" headerValue="-- Select Group Type --"
        			  list="#session.S_GROUP_TYPES" listKey="listValueId" listValue="listValueName" />
		</td>
	</tr>
	<tr>
		<td colspan="2" align="center">
			<s:submit value=" Save " theme="simple" />
			<input type="button" value=" Close " onClick="Popup.hide('modal')">
		</td>
	</tr>
	</s:form>
	</table>
</div>

<span style="width: 705px; height: 28; text-align: right">
	<input type="button" value="Add Group" style="border: 1px solid #222222; width: 100px"
		   onclick="groupForm(0,'','',0)">
</span>

<table width="700" bgcolor="#CCCCCC" cellspacing="1" align="center">
<tr style="background-image: url('images/gradtblhdr.gif')">
	<th width="150px" height="22">Group Code</th>
	<th width="240px">Group Name</th>
	<th width="240px">Group Type</th>
	<th width="70px">&nbsp;</th>
</tr>
<s:iterator value="groupList">
<tr bgcolor="#FFFFFF">
	<td height="23" align="center"><s:property value="groupCode"/></td>
	<td style="padding-left: 5px"><s:property value="groupName"/></td>
	<td style="padding-left: 5px"><s:property value="groupTypeName"/></td>
	<td align="center">
		<input type="button" id="btnGroupForm" value="Edit"
			   style="width: 45px; height: 20px; background-color: #FFFFFF; border: 1px #555555 solid"
			   onclick="groupForm('<s:property value="groupId"/>','<s:property value="groupCode"/>'
			   					 ,'<s:property value="groupName"/>','<s:property value="groupTypeId"/>')">
	</td>
</tr>
</s:iterator>
</table>
 
</body>
</html>
